package me.lc.superDown.sprite;

import me.lc.superDown.core.GameSystem;

import com.wiyun.engine.nodes.AtlasLabel;
import com.wiyun.engine.nodes.Node;
import com.wiyun.engine.nodes.Sprite;
import com.wiyun.engine.types.WYColor3B;
import com.wiyun.engine.utils.ResolutionIndependent;

public class ClockBar extends Node {
	Sprite clock;
	AtlasLabel secondCount;

	public ClockBar() {
		clock = Sprite.make(GameSystem.tex_clock);
		clock.setAnchorX(0);
		secondCount = AtlasLabel.make("0", GameSystem.tex_number,
				GameSystem.charMap);
		secondCount.setColor(WYColor3B.make(230, 100, 0));
		secondCount.setAnchorX(0);

		addChild(clock);
		addChild(secondCount);

		secondCount.setPosition(GameSystem.tex_clock.getWidth()
				+ ResolutionIndependent.resolveDp(5), 0);
	}

	public void setSecond(int second) {
		secondCount.setText(second + "");
	}
}
